<?php

declare (strict_types=1);
/**
 * @copyright 深圳市易果网络科技有限公司
 * @version 1.0.0
 * @link https://dayiguo.com
 */

namespace App\Controller\agent;

use App\Kernel\Util\AgentJwtInstance;
use App\Middleware\User\AgentMiddleware;
use App\Service\Agent\BusinessService;
use Hyperf\Guzzle\ClientFactory;

use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;
use Hyperf\Snowflake\IdGeneratorInterface;
use Hyperf\HttpServer\Annotation\Middleware;

/**
 * 商家
 *
 * @AutoController()
 * @Middleware(AgentMiddleware::class)
 * @author 张昊(2396675557@qq.com)
 * @package App\Controller\admin
 */
class BusinessController extends Controller
{

    /**
     * @Inject
     * @var BusinessService
     */
    public $business_service;

    /**
     * 商家列表
     */
    public function list()
    {
        $result = $this->business_service->list();

        $this->success($result);
    }

    /**
     * 商家搜索
     */
    public function search()
    {
        $params = $this->request->all();
        $business_list = $this->business_service->getBusinessList($params);

        $this->success($business_list);
    }
}